﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Activation;
using System.Text;
using MailRuWrapper.Server.PaymentService;

namespace PaymentServiceDemo
{
    [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
    public class PaymentServiceDemo : IPaymentService
    {

        //http://localhost:8732/PaymentServiceDemo/paymentService?app_id=12341&transaction_id=3751&service_id=19&uid=10410773181171625989&sms_price=3&sig=b41467e049d82dad39f69769d13554d4&debug=1
        public Stream InvokePaymentService(int appID, int transactionID, int serviceID, string uid, string sig, int smsPrice, int otherPrice, int debug)
        {
            var _init = new Dictionary<string, string>
                            {
                                {"app_id", "427107"},
                                {"session_key", "f83de8f145a82e59ea22f078f99289c7"},
                                {"authentication_key", "7d9cb73b559fe3c481e6742418ecc937"},
                                {"is_app_user", "1"},
                                {"oid", "13522930837595030077"},
                                {"vid", "13522930837595030077"},
                                {"window_id", "CometName_0c9bcb7f6f6e458996a186e424771803"},
                                {"ext_perm", "notifications,stream"}
                            };

            var _wrapper = new MailRuWrapper.Server.ServerWrapper("653ff57690a70502876004418b6488aa", _init);

            var _isSigChecked = PaymentServiceHelper.CheckSIG("653ff57690a70502876004418b6488aa");
            return PaymentServiceHelper.GetResponse(Status.Success);
        }

    }
}
